Skip to content

fix(opencode): add lsp sync range for roslyn and fix workspacesymbol query#23612

Open
VladD2 wants to merge 8 commits intoanomalyco:devfrom
rsdn:vladd2-bug-23075-workspace-symbol-empty-query
Open

fix(opencode): add lsp sync range for roslyn and fix workspacesymbol query#23612
VladD2 wants to merge 8 commits intoanomalyco:devfrom
rsdn:vladd2-bug-23075-workspace-symbol-empty-query

Conversation

@VladD2
Copy link
Copy Markdown

@VladD2 VladD2 commented Apr 21, 2026

Issue for this PR

Closes #23075

Type of change

  • Bug fix
  • Refactor / code improvement
  • New feature
  • Documentation

What does this PR do?

The problem:

  1. Broken workspaceSymbol: It was always sending an empty string as a query, making it impossible to find symbols across the workspace (as reported in LSP workspaceSymbol is always send with empty query #23075).
  2. Over-strict validation: Both workspaceSymbol and documentSymbol previously required line and character parameters, which are not actually needed for these operations.

The changes:

  • Improved symbol lookup: Added an query parameter for workspaceSymbol and removed unnecessary position validation for documentSymbol.
  • Refactored parameter validation: Moved line and character checks further down the logic so they only trigger for operations that actually require a specific cursor position (like goToDefinition or hover).
  • Tests updated and added for all LSP methods

How did you verify your code works?

  • Verified that the Roslyn LSP server no longer crashes on file changes.
  • Tested workspaceSymbol with various query strings.
  • Confirmed documentSymbol works correctly without providing line/character parameters.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown
Contributor

Hey! Your PR title Fix: Roslyn crash via incremental sync range and broken workspaceSymbol query doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@VladD2 VladD2 changed the title Fix: Roslyn crash via incremental sync range and broken workspaceSymbol query fix(opencode): add lsp sync range for roslyn and fix workspacesymbol query Apr 21, 2026
@VladD2 VladD2 force-pushed the vladd2-bug-23075-workspace-symbol-empty-query branch 2 times, most recently from a507a9d to 6bfb645 Compare April 22, 2026 20:44
@VladD2 VladD2 force-pushed the vladd2-bug-23075-workspace-symbol-empty-query branch from 6bfb645 to 564a03d Compare April 27, 2026 00:47
@Hona
Copy link
Copy Markdown
Member

Hona commented Apr 27, 2026

I did this recently #23771

@VladD2 are you able to link me a repo/repro that fails on the latest opencode, but passes on this PR?

@VladD2 VladD2 force-pushed the vladd2-bug-23075-workspace-symbol-empty-query branch from ac00e93 to 247d7e0 Compare April 27, 2026 16:47
@VladD2
Copy link
Copy Markdown
Author

VladD2 commented Apr 27, 2026

I did this recently #23771

@VladD2 are you able to link me a repo/repro that fails on the latest opencode, but passes on this PR?

Ah, my changes to packages/opencode/src/lsp/client.ts were made before #23771 landed — I've reverted those.

The core of this PR is LSP method parameter validation and fixs:

workspaceSymbol now passes the query from the AI to the LSP (previously always sent empty string, which was the main bug)
workspaceSymbol now requires a query parameter (previously always sent as empty string, causing LSP servers to return all symbols)
documentSymbol only requires filePath
• All other operations require filePath, line, and character

PS

Please review this PR soon — I'm getting merge conflicts with dev every day.

@VladD2
Copy link
Copy Markdown
Author

VladD2 commented May 1, 2026

@Hona @rekram1-node Please review this PR soon — I'm getting merge conflicts with dev every day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSP workspaceSymbol is always send with empty query

2 participants